//
//  TMNetwork.h
//  TMtravel
//
//  Created by Playboy on 17/3/10.
//  Copyright © 2017年 tmkj. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TMBaseReqModel.h"
#import "AFNetworking.h"

typedef void (^networkCompleteBlock)(TMBaseReqModel *model);

@interface TMNetwork : NSObject

@property (nonatomic, strong) AFHTTPSessionManager *manager;

+ (TMNetwork *)manager;

/**
 网络请求

 @param param 请求参数
 @param urlString 请求地址
 @param callback 回调信息
 */
+ (void)requestPostWithParam:(id)param url:(NSString *)urlString callback:(networkCompleteBlock)callback;


+ (void)requestGetWithParam:(NSDictionary *)param url:(NSString *)urlString callback:(networkCompleteBlock)callback;

/**
 图片上传

 @param imageData 图片Data数组
 @param urlString url地址
 @param callback 回调信息
 */
+ (void)requestImageWithImage:(NSData *)imageData url:(NSString *)urlString callback:(networkCompleteBlock)callback;

+ (void)requestImageWithImageArray:(NSArray *)imageArray callback:(networkCompleteBlock)callback;


/**
 支付宝支付
 
 @param param 参数
 */
+ (void)alipayWithParam:(NSString *)param;


- (AFNetworkReachabilityStatus)networkStatus;

@end
